package dao

import (
	"onerk4/zk1/global"
	"onerk4/zk1/models"
)

func QueryUserByMobile(mobile string) (result *models.Users, err error) {
	err = global.DB.Model(&models.Users{}).Where("mobile = ?", mobile).First(&result).Error
	return
}

func QueryOrderByUid(uid uint) (result []*models.Order, err error) {
	err = global.DB.Model(&models.Order{}).Where("uid = ?", uid).Find(&result).Error
	return
}

func QueryProductList() (result []*models.Product, err error) {
	err = global.DB.Model(&models.Product{}).Find(&result).Error
	return
}
